#include "genericplugin.h"

GenericPlugin::GenericPlugin(QObject *parent)
    : QGenericPlugin(parent)
{}

QObject *GenericPlugin::create(const QString &name, const QString &spec)
{
    qDebug() << "GenericPlugin =  Creating:" << name << "with spec:" << spec;

    if (name == "ToolManager") {
        return new ToolManager(this);
    }
    else if (name == "DialogManager") {
        return new DialogManager(this);
    }
    else if (name == "ConfigurableTool") {
        // 使用 spec 参数进行配置
        return new ToolManager(this); // 实际中会根据 spec 配置
    }

    return nullptr;
}
